#include "navigatebar.h"

#include <QPushButton>
#include <QToolButton>
#include <QVBoxLayout>
#include <QSpacerItem>
#include <QDebug>

NavigateBar::NavigateBar(QWidget *parent)
    : QWidget{parent}
{
    this->resize(75,750);
    QVBoxLayout * vNavLayout  = new QVBoxLayout(this);
    vNavLayout->setMargin(0);
    QSpacerItem * spacer1 = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Fixed);
    vNavLayout->addSpacerItem(spacer1);
    QToolButton * btn = new QToolButton(this);
    btn->setStyleSheet("QToolButton{background-color:transparent;color:white;font-size:8pt;}");
    btn->setIcon(QIcon(":/images/icon/images/main-btn.png"));
    btn->setText("智享家");
    btn->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    btn->setIconSize(QSize(75,75));
    vNavLayout->addWidget(btn,0,Qt::AlignCenter);
    QSpacerItem * spacer2 = new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Fixed);
    vNavLayout->addSpacerItem(spacer2);

    QVBoxLayout * group1 = new QVBoxLayout(this);
    group1->setSpacing(10);
    vNavLayout->addLayout(group1);
    QPushButton * group1_btn1 = new QPushButton(this);
    group1_btn1->setStyleSheet("QPushButton{background-color:transparent;}");
    group1_btn1->setIcon(QIcon(":/images/icon/images/home-0.png"));
    group1_btn1->setIconSize(QSize(40,40));
    group1->addWidget(group1_btn1,0,Qt::AlignCenter);
    QPushButton * group1_btn2 = new QPushButton(this);
    group1_btn2->setStyleSheet("QPushButton{background-color:transparent;}");
    group1_btn2->setIcon(QIcon(":/images/icon/images/light-0.png"));
    group1_btn2->setIconSize(QSize(40,40));
    group1->addWidget(group1_btn2,0,Qt::AlignCenter);
    QPushButton * group1_btn3 = new QPushButton(this);
    group1_btn3->setStyleSheet("QPushButton{background-color:transparent;}");
    group1_btn3->setIcon(QIcon(":/images/icon/images/fun-0.png"));
    group1_btn3->setIconSize(QSize(40,40));
    group1->addWidget(group1_btn3,0,Qt::AlignCenter);
    QPushButton * group1_btn4 = new QPushButton(this);
    group1_btn4->setStyleSheet("QPushButton{background-color:transparent;}");
    group1_btn4->setIcon(QIcon(":/images/icon/images/fun1-0.png"));
    group1_btn4->setIconSize(QSize(40,40));
    group1->addWidget(group1_btn4,0,Qt::AlignCenter);
    QSpacerItem * spacer3 = new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Fixed);
    vNavLayout->addSpacerItem(spacer3);

    QVBoxLayout * group2 = new QVBoxLayout(this);
    group2->setSpacing(10);
    vNavLayout->addLayout(group2);
    QPushButton * group2_btn1 = new QPushButton(this);
    group2_btn1->setStyleSheet("QPushButton{background-color:transparent;}");
    group2_btn1->setIcon(QIcon(":/images/icon/images/cloud-0.png"));
    group2_btn1->setIconSize(QSize(40,40));
    group2->addWidget(group2_btn1,0,Qt::AlignCenter);
    QPushButton * group2_btn2 = new QPushButton(this);
    group2_btn2->setStyleSheet("QPushButton{background-color:transparent;}");
    group2_btn2->setIcon(QIcon(":/images/icon/images/monitor-0.png"));
    group2_btn2->setIconSize(QSize(40,40));
    group2->addWidget(group2_btn2,0,Qt::AlignCenter);
    QPushButton * group2_btn3 = new QPushButton(this);
    group2_btn3->setStyleSheet("QPushButton{background-color:transparent;}");
    group2_btn3->setIcon(QIcon(":/images/icon/images/warn-0.png"));
    group2_btn3->setIconSize(QSize(40,40));
    group2->addWidget(group2_btn3,0,Qt::AlignCenter);
    QSpacerItem * spacer4 = new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Expanding);
    vNavLayout->addSpacerItem(spacer4);
}
